#ifndef _COUNTER_H_
#define _COUNTER_H_


/*
	class : Counter<CountValue>
	desc : Implements a simple to use interface for a
		counter. This counter flags when the max
		value is reached.
*/
template<typename CountValue> 
class Counter
{
	private:
		//current count of the counter
		CountValue count;
		//initial start value to reset the counter to
		CountValue initial;
		//the max count value 
		CountValue max;
	public:
		//default constructor
		Counter();
		//constructor sets the count and max count values
		Counter(CountValue c, CountValue m); //sets the max and current.
		//increments the count prefix		
		void operator++();
		//increments the count postfix
		void operator++(int i);
		//decrements the count prefix
		void operator--(int i);
		//decrements the count postfix
		void operator--();
		//resets the count to c
		void resetCount(CountValue c);
		//returns if the max has been reached.
		bool flag(); //gives a flag of when the max is reached
		//gets the current count value
		CountValue getCount(); //gets the count value.
		//gets the max count value.
		CountValue getMax(); //gets the max value.
};

#include "Counter.cpp"


#endif
